<template>
  <div class="container">
     <!-- 顶部广告 -->
     <!-- <div>
      <van-image
        style="display: block;"
        height="52"
        src="https://yanxuan.nosdn.127.net/static-union/16607924415e76bf.png?type=webp&imageView&thumbnail=750x0&quality=75"
      />
    </div> -->

    <!-- 头部区域 -->
    <div class="headerBox">
      <img class="bgImg" src="https://yanxuan.nosdn.127.net/5905098f74e04c39fa5e76ebb9ff591b.png" alt="">
      <div class="userInfoBox">
        <!-- 左边头像 -->
        <div class="left">
          <van-image
            round
            width="70"
            height="70"
            :src="userInfoStore.userInfo.headImg"
          />
        </div>
        <!-- 中间用户信息 -->
        <div class="middle">
          <div class="useName">{{ userInfoStore.userInfo.nickName }}</div>
          <div class="power">普通用户</div>
        </div>
        <!-- 右边二维码 -->
        <div class="right">
          <van-image
            width="32"
            height="32"
            src="src/assets//images/rqcode.png"
          />
        </div>
      </div>
      <div class="vipBox">
        <div class="leftIcon">
          <img class="iconImg" src="../../assets/images/vipIcon.png" alt="">
        </div>
        <div class="rightText">
          Pro会员<br>
          立即开通
        </div>
      </div>
    </div>

    <!-- 我的资产 -->
    <div class="property">我的资产</div>

    <!-- 卡券区域 -->
    <div class="couponBox">
      <div class="couponItem">
        <van-badge dot>
          <div class="number">￥0</div>
        </van-badge>
        <div>余额</div>
      </div>
      <div class="couponItem">
        <div class="number">0</div>
        <div>红包</div>
      </div>
      <div class="couponItem">
        <div class="number">0</div>
        <div>优惠卷</div>
      </div>
      <div class="couponItem">
        <div class="number">0</div>
        <div>积分</div>
      </div>
      <div class="couponItem">
        <div class="number">0</div>
        <div>礼品卡</div>
      </div>
    </div>

    <!-- 限时开通 -->
    <div class="obstacles">
      <van-icon class="vipCard" name="vip-card-o" color="red" />
      <span>11.11省钱卡</span>
      <span class="cordIcong">花3得34元 一笔回本</span>
      <van-button class="btn" size="mini" round color="linear-gradient(to right, #ff6034, #ee0a24)">限时开通</van-button>
    </div>

    <div style="height: 12px;background-color: #ddd;"></div>

    <!-- 订单区域 -->
    <van-grid class="orderBox" :column-num="3">
      <van-grid-item to="/myorder" icon="balance-list-o" text="我的订单" />
      <van-grid-item icon="user-circle-o" text="账号管理" />
      <van-grid-item icon="phone-o" text="我的手机号" />
      <van-grid-item icon="friends-o" text="周六一起拼" />
      <van-grid-item icon="user-o" text="售后服务" />
      <van-grid-item icon="balance-pay" text="邀请返利" />
      <van-grid-item icon="goods-collect-o" text="优先购" />
      <van-grid-item icon="gold-coin-o" text="积分中心" />
      <van-grid-item icon="gem-o" text="会员俱乐部" />
      <van-grid-item icon="location-o" text="地址管理" />
      <van-grid-item icon="shield-o" text="支付安全" />
      <van-grid-item icon="service-o" text="帮助与客服" />
      <van-grid-item icon="records-o" text="意见反馈" />
      <van-grid-item icon="bar-chart-o" text="我的竞拍" />
    </van-grid>

    <div style="height: 12px;background-color: #ddd;"></div>

    <van-button @click="outLogin" class="outLogin" type="default">退出登录</van-button>
    
    <div style="height: 12px;background-color: #ddd;"></div>

  </div>
</template>

<script lang="ts" setup>
import { useUserInfoStore } from '../../store/userInfo';
import { useRouter } from 'vue-router';
import { showSuccessToast } from 'vant';

const userInfoStore = useUserInfoStore()
const router = useRouter()



const outLogin = () => {
  userInfoStore.resetUserInfo()
  showSuccessToast('账号退出成功');
  router.push('/home')
}



</script>

<script lang="ts">
export default {
  name: 'canter'
}
</script>

<style lang="scss" scoped>
.container{
  padding-bottom: 50px;
  .headerBox{
    height:135px;
    position:relative;
    .bgImg{
      height:100%;
      width:100%;
    }
    .userInfoBox{
      height:135px;
      position: absolute;
      top:0;
      left:0;
      display: flex;
      align-items: center;
      .left{
        margin-left:20px;
      }
      .middle{
        margin-left: 20px;
        color:white;
        .useName{
          font-size: 20px;
        }
        .power{
          margin-top:10px;
          font-size: 13px;
        }
      }
      .right{
        margin-left:80px;
        margin-top:-50px;
      }
    }
    .vipBox{
      position: absolute;
      right:0;
      bottom: 20px;
      width:111px;
      height:42px;
      border-radius: 30px 0 0 30px;
      background: linear-gradient(180deg,#574e44,#0e0e0e); 
      display: flex;
      align-items: center;
      .leftIcon{
        width:28px;
        height:28px;
        border-radius: 50%;
        margin-left:10px;
        background: linear-gradient(90deg,#574e44,#0e0e0e); 
        overflow: hidden;
        .iconImg{
          width:28px;
          height:28px;
          margin-left:1px;
          margin-top:-2px;
        }
      }
      .rightText{
        margin-left: 8px;
        color:#f9e0c0;
        font-size: 11px;
      }
    }
  }
  .property{
    height:53px;
    font-size: 14px;
    border-bottom: 1px solid black;
    line-height: 53px;
    margin-left: 20px;
  }
  .couponBox{
    height:80px;
    display: flex;
    align-items: center;
    padding:0 20px;
    justify-content: space-between;
    .couponItem{
      display: flex;
      flex-direction: column;
      align-items: center;
      font-size: 12px;
      .number{
        font-size: 16px;
        font-weight: bold;
        margin-bottom: 10px;
      }
    }
  }
  .obstacles{
    height: 45px;
    border-radius: 5px;
    border:1px solid rgba(221,26,33,.1);
    background-color: #fff6f4;
    margin:0 15px;
    font-size: 14px;
    display: flex;
    align-items: center;
    padding:0 15px;
    margin-bottom: 10px;
    .vipCard{
      font-size: 30px;
      margin-right: 8px;
    }
    .cordIcong{
      color:#574e44;
      font-size: 12px;
      margin-left: 10px;
      padding-left: 5px;
      border-left: 1px solid #574e44;
    }
    .btn{
      padding:0 10px;
      margin-left: 15px;
    }
  }
  .orderBox{
    display: flex;
    flex-wrap: wrap;
  }
  .outLogin{
    width:100%;
    font-size: 14px;
  }
}
</style>
